Skip to content

Refactor commands to thin wrappers invoking skills#46

Merged
arittr merged 8 commits intomainfrom
claude/research-spectacular-multirepo-v3PjR
Jan 22, 2026
Merged

Refactor commands to thin wrappers invoking skills#46
arittr merged 8 commits intomainfrom
claude/research-spectacular-multirepo-v3PjR

Conversation

@arittr
Copy link
Copy Markdown
Owner

@arittr arittr commented Jan 22, 2026

Summary

Refactored the spectacular plugin architecture to implement a pure skills-based design pattern. Commands are now thin wrappers (~5 lines) that invoke skills, with all orchestration logic moved into self-contained skill modules. This reduces cognitive load on users and improves maintainability.

Key Changes

  • Commands refactored to thin wrappers: init.md, plan.md, execute.md, and spec.md now simply invoke their corresponding skills rather than containing full implementation logic
  • Skills contain all logic: Created/updated skills to be self-contained:
    • validating-environment - Environment validation (replaces init.md logic)
    • decomposing-tasks - Plan generation (replaces plan.md logic)
    • executing-plan - Execution orchestration (replaces execute.md logic)
    • writing-specs - Spec generation (replaces spec.md logic)
  • Multi-repo support documented: Added comprehensive section explaining workspace structure, auto-detection, per-repo requirements, and execution behavior for features spanning multiple repositories
  • Architecture documentation updated: Clarified command vs skill distinction and updated plugin structure diagram to show the new pure skills architecture
  • Development guidelines added: New section on multi-repo feature development workflow

Implementation Details

  • Commands now follow a consistent pattern: read input, invoke skill, report results
  • Skills are invoked using the Skill tool and followed exactly as presented
  • Multi-repo mode auto-detects based on directory structure (multiple .git/ subdirs)
  • Plans in multi-repo mode include repo: field for each task
  • Parallel phases can execute tasks across different repos simultaneously
  • Each repo maintains its own git-spice stack (cannot stack across repos)

Benefits

  • Reduced cognitive load: Users see focused command descriptions instead of 300+ line implementations
  • Better skill reusability: Skills can be invoked by multiple commands or other skills
  • Improved maintainability: Orchestration logic changes don't affect command interfaces
  • Clearer separation of concerns: Commands handle user interaction, skills handle implementation
  • Multi-repo scalability: Architecture supports complex features spanning multiple repositories

Validated design for extending spectacular to support multi-repo workflows:
- Pure skills architecture (matching superpowers pattern)
- Single spec + plan at workspace root with repo-tagged tasks
- Per-repo worktrees, constitutions, and setup commands
- Coordinated PR submission across repos
12 tasks across 4 phases:
- Phase 1: Architecture refactor (parallel) - Convert commands to thin wrappers
- Phase 2: Multi-repo core (parallel) - Add repo field, workspace detection
- Phase 3: Execution updates (sequential) - Per-repo worktrees and setup
- Phase 4: PR submission & polish (sequential) - Multi-repo finishing workflow

Estimated: ~36h sequential, ~24h with parallelization (33% savings)
Architecture refactor following superpowers pattern:
- Commands now invoke skills directly (5 lines each)
- All orchestration logic moved to skills

New skills:
- validating-environment: Environment validation with multi-repo detection
- executing-plan: Plan execution orchestration

Updated skills:
- writing-specs: Now includes full workflow (Run ID, worktree, brainstorm, spec, validation)
- decomposing-tasks: Now includes full workflow (Run ID extraction, worktree context, plan generation)

This is Phase 1 of multi-repo support implementation.
writing-specs skill:
- Workspace detection (single-repo vs multi-repo)
- Multi-repo skips worktree creation (specs at workspace root)
- Multi-repo spec template with per-repo constitution references
- Separate completion messages for each mode

decomposing-tasks skill:
- Multi-repo detection with repo listing
- Tasks include repo: field in multi-repo mode
- Cross-repo dependency analysis (different repos = independent)
- Multi-repo plan template with per-repo breakdown
- Report includes per-repo task/hours summary

Backwards compatible: single-repo mode unchanged.
executing-plan skill:
- Multi-repo workspace detection
- Per-repo context passing to phase skills
- Per-repo final report with branch stacks

executing-parallel-phase skill:
- Create worktrees in correct repo directory
- Read setup commands from per-repo CLAUDE.md
- Pass per-repo constitution to subagents
- Per-repo cleanup and stacking

executing-sequential-phase skill:
- Switch repo context between tasks
- Create per-repo main worktrees as needed
- Per-repo setup command lookup
- Per-repo stacking documentation

All skills maintain backwards compatibility with single-repo mode.
CLAUDE.md:
- Updated architecture section for pure skills pattern
- Added comprehensive Multi-Repo Support section
- Added workspace structure, plan format, execution behavior docs
- Added multi-repo feature development workflow

using-git-spice skill:
- Added Multi-Repo Workflows section
- Documented per-repo stacking limitation
- Added phase-ordered PR submission guide
- Added cross-repo dependency coordination

validating-environment skill:
- Enhanced per-repo validation (CLAUDE.md, setup commands, constitutions)
- Creates workspace-level specs directory
- Added multi-repo summary with per-repo status

This completes Phase 4 of multi-repo support implementation.
Add test scenarios to verify multi-repo support implementation:
- init/multi-repo-detection.md: Workspace mode detection
- plan/multi-repo-task-format.md: Repo field in task format
- execute/multi-repo-execution.md: Per-repo worktrees and setup
@arittr arittr merged commit 3512a1b into main Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants